<div class="main row">
    <div class="catego-title2">
        <h2 class="clearfix">
            <a href="#"><span><?php echo $page_title; ?></span></a>
            <div class="dropdown dropdown-style pull-right">
                <a id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="#"></a>
                <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                    <li><a href="<?php echo $base_url . "van-ban-phap-quy-group"; ?>">Văn bản mới</a></li>
                    <li><a href="<?php echo $base_url . "van-ban-phap-quy-group"; ?>">Văn bản VPCP</a></li>
                    <li><a href="<?php echo $base_url . "van-ban-phap-quy-group"; ?>">Văn bản chính phủ</a></li>
                    <li><a href="<?php echo $base_url . "van-ban-phap-quy-group"; ?>">Văn bản Bộ tài chính</a></li>
                    <li><a href="<?php echo $base_url . "van-ban-phap-quy-group"; ?>">Văn bản các bộ ngành</a></li>
                    <li><a href="<?php echo $base_url . "van-ban-phap-quy-group"; ?>">Văn bản Tổng cục Hải quan</a></li>
                    <li><a href="<?php echo $base_url . "van-ban-phap-quy-group"; ?>">Văn bản quốc hội</a></li>
                </ul>
            </div> 
        </h2>
    </div>  
    
    <div class="panel panel-default">
        <table class="table">
            <?php
            $this->load->library('Mobile_Detect');
            $detect = new Mobile_Detect();
            if ($detect->isTablet()){
            ?>
            <thead>
                <tr>
                    <th>STT</th>
                    <th>Số công văn</th>
                    <th>Ngày ban hành</th>
                    <th>Ngày hiệu lực</th>
                    <th>Nội dung</th>
                </tr>
            </thead>
            <tbody>
                <?php 
                $i = $pagesize*($cur_page-1)+1; 
                foreach ($aDocs as $key=> $item): 
                ?>
                <tr>
                    <td>
                        <?php echo $i;?>
                    </td>
                    <td>
                        <?php echo $item->title;?>
                    </td>
                    <td>
                        <?php echo date( "Y-m-d", strtotime($item->issue_date));?>
                    </td>
                    <td>
                        <?php echo date( "Y-m-d", strtotime($item->apply_date));?>
                    </td>
                    <td>
                        <?php echo $item->desc;?>
                        <?php if ($item->file != ""){ ?>
                            <br>
                            <a class="vbpq-downloadfile" href="<?php echo $img_url."style/".$item->file; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/Save-icon.png" border=0><span style="padding-left: 5px; vertical-align: bottom;">Tải về</span></a>
                        <?php } ?>
                    </td>
                </tr>
                <?php 
                    $i++; 
                endforeach; ?>                
            </tbody>
            <?php
            }else{
            ?>    
            <thead>
                <tr>
                    <th>STT</th>
                    <th>Số công văn/ Ngày ban hành/ Ngày hiệu lực</th>
                    <th>Nội dung</th>
                </tr>
            </thead>
            <tbody>
                <?php 
                $i = $pagesize*($cur_page-1)+1; 
                foreach ($aDocs as $key=> $item): 
                ?>
                <tr>
                    <td>
                        <?php echo $i;?>
                    </td>
                    <td>
                        <?php echo $item->title . "<br/><br/>" . date( "Y-m-d", strtotime($item->issue_date)) . "<br/>" . date( "Y-m-d", strtotime($item->apply_date)); ?>
                    </td>
                    <td>
                        <?php echo $item->desc;?>
                        <?php if ($item->file != ""){ ?>
                            <br>
                            <a class="vbpq-downloadfile" href="<?php echo $img_url."style/".$item->file; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/Save-icon.png" border=0 valign="middle"><span style="padding-left: 5px; vertical-align: bottom;">Tải về</span></a>
                        <?php } ?>
                    </td>
                </tr>
                <?php 
                    $i++; 
                endforeach; ?>                
            </tbody>
            <?php
            }
            ?>
        </table>
        
        <?php echo $paging; ?>
    </div>
    
</div>

<div class="block-adv">
</div>